<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:choose>
	<c:when test="${user != null}">
<%-- 		<c:if test="${usertype == 'Support User'}"> --%>
<%-- 			<jsp:forward page="404.jsp" /> --%>
<%-- 		</c:if> --%>
	</c:when>
	<c:otherwise>
		<jsp:forward page="login.jsp" />
	</c:otherwise>
</c:choose> 
<div id="content">

	<!--  start page-heading -->
	<div id="page-heading">
		<h1><center>Search Account</center></h1>
	</div>
	<!-- end page-heading -->

	<!--  start top-search -->
	<div id="message-area">
		<span style="color: red">${error}</span>
	</div>
	<div id="top-search">
		<form action="searchIDCard.html" method="post">
			<table border="0" cellpadding="0" cellspacing="0">
				<tr>

					<td><input type="text" value="" name="txtSearchAccount"
						onblur="if (this.value=='') { this.value='ID Card Number'; }"
						onfocus="if (this.value=='ID Card Number') { this.value=''; }"
						class="top-search-inp" /></td>

					<td><input type="submit" class="btnReject" value="Search"
						id="approve"></input></td>

				</tr>
			</table>
		</form>
	</div>
	<!--  end top-search -->
	<table border="0" width="100%" cellpadding="0" cellspacing="0"
		id="content-table">
		<tr>
			<th rowspan="3" class="sized"><img
				src="resource/images/shared/side_shadowleft.jpg" width="20"
				height="300" alt="" /></th>
			<th class="topleft"></th>
			<td id="tbl-border-top">&nbsp;</td>
			<th class="topright"></th>
			<th rowspan="3" class="sized"><img
				src="resource/images/shared/side_shadowright.jpg" width="20"
				height="300" alt="" /></th>
		</tr>


		<tr>
			<td id="tbl-border-left"></td>
			<td>
				<!--  start content-table-inner ...................................................................... START -->
				<div id="content-table-inner">

					<!--  start table-content  -->
					<div id="table-content">




						<!--  start product-table ..................................................................................... -->
						<form id="mainform" action="">
							<table border="0" width="100%" cellpadding="0" cellspacing="0"
								id="product-table">
								<thead>
									<!-- 											<tr> -->

									<!-- 												<th>Show <select name="mytable_length" -->
									<!-- 													aria-controls="mytable" class=""> -->
									<!-- 														<option value="10">10</option> -->
									<!-- 														<option value="25">25</option> -->
									<!-- 														<option value="50">50</option> -->
									<!-- 														<option value="100">100</option> -->
									<!-- 												</select></th> -->

									<!-- 											</tr> -->

									<tr>
										<th class="table-header-repeat line-left "><a
											href="">Type</a></th>
										<th class="table-header-repeat line-left "><a
											href="">Account Number</a></th>
										<th class="table-header-repeat line-left "><a
											href="">ID Card Number</a></th>
										<th class="table-header-repeat line-left "><a
											href="">First Name</a></th>
										<th class="table-header-repeat line-left "><a
											href="">Last Name</a></th>
										<th class="table-header-repeat line-left "><a
											href="">Middle Name</a></th>
										<th class="table-header-repeat line-left "><a
											href="">Mobile Phone</a></th>
										<th class="table-header-repeat line-left "><a
											href="">Email</a></th>
										<th class="table-header-repeat line-left "><a href="">State</a></th>
										<th class="table-header-options line-left"><a href="">Options</a></th>
									</tr>
								</thead>
								<tbody>

									<c:choose>
										<c:when test="${accounts.size() > 0}">
											<c:forEach items="${accounts}" var="acc">

												<tr>
													<td align="center">${acc.accountType}</td>
													<td align="center"><a
														href="detailAccount.html?accountId=${acc.accountId}">${acc.accountNumber}</a></td>
													<td align="center">${acc.idCustomer.idCardNumber}</td>
													<td align="center">${acc.idCustomer.firstName}</td>
													<td align="center">${acc.idCustomer.lastName}</td>
													<td align="center">${acc.idCustomer.midName}</td>
													<td align="center">${acc.idCustomer.mobilePhone}</td>
													<td align="center">${acc.idCustomer.email}</td>
													<td align="center">${acc.idState.nameState}</td>
													<c:choose>
														<c:when test="${acc.idState.nameState =='active' }">
															<c:choose>
																 <c:when test="${usertype == 'Admin User'}">
 																	
 																		<td>
 																			<input
																		onClick="location.href='detailAccount.html?accountId=${acc.accountId}'"
																		type="button" class="btnReject" value="Detail" id="detail" />
 																		</td>
																	
																	
																</c:when> 
																<c:otherwise>
																	<td>
																		<input
																		onClick="location.href='detailAccount.html?accountId=${acc.accountId}'"
																		type="button" class="btnReject" value="Detail" id="detail" />
																		<input
																		onClick="location.href='sendAddRequest.html?accNumber=${acc.accountNumber}'"
																		type="button" class="btnReject" value="Add" id="add" /> <input
																		onClick="location.href='sendWithdrawRequest.html?accNumber=${acc.accountNumber}'"
																		type="button" class="btnReject" value="Withdraw"
																		id="withdraw" /> <input
																		onClick="location.href='transferTransAdd.html?senderAccountNumber=${acc.accountNumber}'"
																		type="button" class="btnReject" value="Transfer"
																		id="transfer" /> 
																		
		
																	</td>
																</c:otherwise>
															</c:choose>
															
														</c:when>
														<c:otherwise>
															<td>
								
																<input
																onClick="location.href='detailAccount.html?accountId=${acc.accountId}'"
																type="button" class="btnReject" value="Detail" id="detail" />
															</td>
														</c:otherwise>
													</c:choose>
												</tr>



											</c:forEach>

										</c:when>
										<c:otherwise>
											<tr>
												<td></td>
												<td><a href=""></a></td>
												<td></td>
												<td></td>
												<td></td>
												<td></td>
												<td></td>
												<td></td>
												<td></td>
												<td></td>
											</tr>
										</c:otherwise>
									</c:choose>

								</tbody>
							</table>
							<!--  end product-table................................... -->

						</form>

					</div>
					<!--  end content-table  -->

					<!--  start actions-box ............................................... 
			<div id="actions-box">
				<a href="" class="action-slider"></a>
				<div id="actions-box-slider">
					<a href="" class="action-edit">Edit</a>
					<a href="" class="action-delete">Delete</a>
				</div>
				<div class="clear"></div>
			</div>
			<!-- end actions-box........... -->
					<!-- 							<div id="mytable_info" class="dataTables_info" role="status" -->
					<!-- 								aria-live="polite">Showing 1 to 5 of 5 entries</div> -->
					<!--  start paging..................................................... -->
					<!-- 							<table border="0" cellpadding="0" cellspacing="0" -->
					<!-- 								id="paging-table"> -->
					<!-- 								<tr> -->



					<!-- 									<td><a href="" class="page-far-left"></a> <a href="" -->
					<!-- 										class="page-left"></a> -->
					<!-- 										<div id="page-info"> -->
					<!-- 											Page <strong>1</strong> / 15 -->
					<!-- 										</div> <a href="" class="page-right"></a> <a href="" -->
					<!-- 										class="page-far-right"></a></td> -->

					<!-- 								</tr> -->
					<!-- 							</table> -->
					<!--  end paging................ -->

					<div class="clear"></div>

				</div> <!--  end content-table-inner ............................................END  -->
			</td>
			<td id="tbl-border-right"></td>
		</tr>
		<tr>
			<th class="sized bottomleft"></th>
			<td id="tbl-border-bottom">&nbsp;</td>
			<th class="sized bottomright"></th>
		</tr>
	</table>
	<div class="clear">&nbsp;</div>

</div>

